home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 June / Amiga Games Extra 1996 #6.iso / userbox / publicdomain / urouhack / source / patchfunc.a < prev    next >
Text File  |  1996-03-24  |  2KB  |  130 lines

  1. ;=============================================================================
  2. ;                    Assembler section for UrouHack 1.4+
  3. ;
  4. ; Patches for the following Functions:
  5. ;
  6. ;       OpenScreen()
  7. ;       OpenScreenTagList()
  8. ;       OpenWindow()
  9. ;       OpenWindowTagList()
  10. ;       CloseScreen()
  11. ;=============================================================================
  12.  
  13.         include intuition/screens.i
  14.         include intuition/intuition_lib.i
  15.         include graphics/graphics_lib.i
  16.         include graphics/rastport.i
  17.  
  18.         XDEF    _newOSRoutine
  19.         XREF    _oldOSRoutine
  20.         XDEF    _newCSRoutine
  21.         XREF    _oldCSRoutine
  22.         XDEF    _newOTLRoutine
  23.         XREF    _oldOTLRoutine
  24.         XDEF    _newOWRoutine
  25.         XREF    _oldOWRoutine
  26.         XDEF    _newOWTLRoutine
  27.         XREF    _oldOWTLRoutine
  28.  
  29.         XREF    _b_left
  30.         XREF    _b_right
  31.         XREF    _b_top
  32.         XREF    _b_bottom
  33.         XREF    _b_height
  34.         XREF    _b_width
  35.         XREF    _w_bottom
  36.         XREF    _psysi
  37.         XREF    @allocNewPens
  38.         XREF    @changeSize
  39.         XREF    @freeNewPens
  40.  
  41. _newCSRoutine   jsr     @freeNewPens
  42.  
  43.         move.l  a2,-(sp)
  44.         move.l  _oldCSRoutine,a2
  45.         jsr     0(a2)
  46.         move.l  (sp)+,a2
  47.         rts
  48.  
  49. _newOSRoutine   move.l  _oldOSRoutine,d0
  50.         bra.s   shared
  51.  
  52. _newOTLRoutine  move.l  _oldOTLRoutine,d0
  53.  
  54. shared          move.l  a2,-(sp)
  55.  
  56.         move.l  d0,a2
  57.         jsr     0(a2)
  58.         move.l  d0,a2
  59.  
  60.         move.l  d0,-(sp)
  61.         jsr     @allocNewPens
  62.         addq.w  #4,sp
  63.  
  64.         tst.w   _psysi
  65.         beq.s   nosysi
  66.  
  67.         move.b  _b_bottom,d0
  68.         move.b  d0,sc_WBorBottom(a2)
  69.  
  70.         move.b  _b_right,d0
  71.         move.b  d0,sc_WBorRight(a2)
  72.  
  73.         move.b  _b_top,d0
  74.         move.b  d0,sc_WBorTop(a2)
  75.  
  76.         move.b  _b_left,d0
  77.         move.b  d0,sc_WBorLeft(a2)
  78.  
  79. nosysi          move.l  a2,d0
  80.         move.l  (sp)+,a2
  81.         rts
  82.  
  83. _newOWRoutine   move.l  _oldOWRoutine,d0
  84.         bra.s   shared1
  85.  
  86. _newOWTLRoutine movem.l d0-d7/a0-a7,-(sp)
  87.         jsr     @changeSize
  88.         movem.l (sp)+,d0-d7/a0-a7
  89.         move.l  _oldOWTLRoutine,d0
  90. shared1         move.l  a2,-(sp)
  91.  
  92.         move.l  d0,a2
  93.         jsr     0(a2)
  94.         move.l  d0,a2
  95.  
  96.         move.l  wd_Flags(a2),d1
  97.  
  98.         moveq   #1,d0
  99.         and.l   d1,d0
  100.         beq.s   noAdjust
  101.  
  102.         moveq   #$20,d0
  103.         and.l   d1,d0
  104.         beq.s   checkRight
  105.  
  106.         tst.b   wd_BorderBottom(a2)
  107.         beq.s   checkRight
  108.         move.b  _b_height,wd_BorderBottom(a2)
  109.  
  110. checkRight      moveq   #$10,d0
  111.         and.l   d1,d0
  112.         beq.s   checkRefresh
  113.  
  114.         tst.b   wd_BorderRight(a2)
  115.         beq.s   checkRefresh
  116.         move.b  _b_width,wd_BorderRight(a2)
  117.  
  118. checkRefresh    moveq   #$30,d0
  119.         and.l   d1,d0
  120.         beq.s   noAdjust
  121.  
  122.         move.l  a2,a0
  123.         jsr     _LVORefreshWindowFrame(a6)
  124.  
  125. noAdjust        move.l  a2,d0
  126.         move.l  (sp)+,a2
  127.         rts
  128.  
  129.         end
  130.